package base2


class Retn<T>(
    val code: Int,
    val err: String?,
    val data: T?
) {
    companion object {
        fun <T> ok(data: T?): Retn<T?> {
            return Retn(0, null, data)
        }

        fun err(code: Int, err: String?): Retn<String?> {
            return Retn(code, err, null)
        }
    }

    override fun toString(): String {
        return "Retn(code=$code, err=$err, data=$data)"
    }
}